/*
 * CornerBreakoutNew.fx
 */

package org.frapwidgets.scene.shape.demo;

import javafx.scene.CustomNode;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.effect.DropShadow;
import javafx.scene.Node;

/**
 * Small CornerBreakout with a styled "NEW" text.
 *
 * @author Jonathan Merritt
 */
public class CornerBreakoutNew extends CustomNode {

  public-init var arcRadius: Number;

  override protected function create () : Node {
    CornerBreakout {
      size: 80
      arcRadius: arcRadius
      fill: LinearGradient {
        startX: 1, startY: 0, endX: 0, endY: 1, proportional: true
        stops: [
          Stop { color: Color.color(0.98, 0.53, 0.08) },
          Stop { offset: 1.0, color: Color.color(1.00, 0.71, 0.33) }
        ]
      }
      item: Text {
        font: Font.font("sans", FontWeight.EXTRA_BOLD, 18)
        content: "NEW"
        fill: Color.WHITE
        effect: DropShadow { offsetX: 0, offsetY: 1, radius: 3 }
      }
    }
  }

}
